package com.bee.commons.enums;

/**
 * @author Damin.yang
 * @date 2019/11/02 17:24
 */
public enum EnableEnum {
    /**
     *
     */
    TRUE(true, "启用"),

    FALSE(false, "禁用");

    private boolean enable;

    private String desc;

    EnableEnum(boolean enable, String desc) {
        this.enable = enable;
        this.desc = desc;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Boolean enable) {
        if (enable != null && enable) {
            return TRUE.getDesc();
        }
        return FALSE.getDesc();
    }
}
